home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 013 / arc_mgr.arc / ARCTV20.ARC / ARCTV.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1987-09-15  |  4.4 KB  |  165 lines

  1.  
  2. (*
  3.  *
  4.  * (C) 1987 Samuel H. Smith, 26-apr-87 (rev. 10-Aug-87)
  5.  *
  6.  * This program is provided courtesy of:
  7.  *         The Tool Shop
  8.  *         Phoenix, Az
  9.  *         (602) 279-2673
  10.  *
  11.  * This program uses many of the building-blocks in the Tool Shop Library,
  12.  * which is available for download from the Tool Shop.   Compile using
  13.  * TSHELL 1.2, also avaliable from the Tool Shop.
  14.  *
  15.  *
  16.  * Disclaimer
  17.  * ----------
  18.  *
  19.  * This software is completely FREE.   I ask only for your comments,
  20.  * suggestions and bug reports.   If you modify this program, I would
  21.  * appreciate a copy of the new source code.   Please don't delete my
  22.  * name from the program.
  23.  *
  24.  * I cannot be responsible for any damages resulting from the use or mis-
  25.  * use of this program!
  26.  *
  27.  * If you have any questions, bugs, or suggestions, please contact me at
  28.  * The Tool Shop,  (602) 279-2673.
  29.  *
  30.  * Enjoy!     Samuel H. Smith
  31.  *
  32.  *)
  33.  
  34.  
  35. {$c+}               (* disable control character trap *)
  36. {$u+}
  37. {$r-,k-}            (* enable range checking *)
  38. {$p800,d-}          (* required for local-echo handler *)
  39. {$v-}               (* allow variable length string params *)
  40.  
  41.  
  42. const
  43.    whoami      = 'Archive Text Viewer';
  44.    version     = 'v2.0, SYSTEM_DATE';
  45.    comfile     = 'ARCTV';
  46.    scratchfile = 'SCRATCH.ARC';
  47.  
  48. var
  49.    ok:              boolean;
  50.    linenum:         integer;
  51.  
  52.  
  53. (* libraries *)
  54.  
  55. #include <anystring.inc> (* general string declaration *)
  56. #include <regpack.inc>   (* register package declaration *)
  57. #include <strutil.inc>   (* string utility macros *)
  58. #include <incdec.inc>    (* scalar increment/decrement *)
  59. #include <getfile2.inc>  (* expand wildcard file lists *)
  60. #include <rempath.inc>   (* path/ext manipulation *)
  61. #include <ftoa.inc>      (* float to ascii conversion *)
  62. #include <itoa1.inc>     (* integer to ascii conversion *)
  63. #include <itoh.inc>      (* integer to hex conversion *)
  64. #include <itou.inc>      (* integer to unsigned-real conversion *)
  65. #include <ltor.inc>      (* long-integer to real conversion *)
  66. #include <mdosio.inc>    (* mini dos-file interface library *)
  67. #include <stoupper.inc>  (* map string to upper case *)
  68. #include <openshar.inc>  (* open shared files macro *)
  69. #include <wildcard.inc>  (* wildcard comparison *)
  70.  
  71. const
  72.    graphics = false;
  73.    lowtxt = '';
  74.    hitxt = '';
  75.    lowv = '';
  76.    hiv = '';
  77.    option = '';
  78.    expert = true;
  79.    dump_user = false;
  80.    carrier_lost = '<lost>';
  81.  
  82. type user_rec = record
  83.         pagelen: integer;
  84.      end;
  85.  
  86. const
  87.    user: user_rec = (pagelen:23);
  88.  
  89.  
  90. procedure make_log_entry(s:anystring;
  91.                          f:boolean);
  92.                                 begin if f then writeln(s);
  93.                                 end;
  94.  
  95. procedure uninit_com;           begin end;
  96.  
  97. procedure newline;              begin writeln;
  98.                                       flush(output);
  99.                                       INCR(linenum);
  100.                                 end;
  101.  
  102. procedure disp(s:longstring);   begin write(s);
  103.                                 end;
  104.  
  105. procedure displn(s:longstring); begin write(s);
  106.                                       newline;
  107.                                 end;
  108.  
  109. procedure input(var s:anystring;
  110.                     l:integer); begin flush(output);
  111.                                       read(s);
  112.                                       linenum := 1;
  113.                                 end;
  114.  
  115.  
  116. #include "promsgs.inc"   (* message/more processing *)
  117.  
  118. #include "prounsq.inc"    (* view archive text files *)
  119.  
  120.  
  121. (*
  122.  * main program
  123.  *
  124.  *)
  125.  
  126. var
  127.    i,j: integer;
  128.    par: anystring;
  129.  
  130. begin
  131.    linenum := 1;
  132.  
  133.    if paramcount = 0 then
  134.    begin
  135.       writeln;
  136.       writeln(whoami,',  ',version);
  137.       writeln('Courtesy of:  S.H.Smith  and  The Tool Shop BBS,  (602) 279-2673.');
  138.       writeln;
  139.       writeln('Usage:  arctv FILE[.arc] ... FILE [>OUT]');
  140.    end;
  141.  
  142.    for i := 1 to paramcount do
  143.    begin
  144.       par := paramstr(i);
  145.  
  146.       if pos('.',par) = 0 then
  147.          par := par + '.ARC';
  148.       for j := 1 to LEN(par) do
  149.          if par[j] = '/' then
  150.             par[j] := '\';
  151.  
  152.       getfiles(par,filetable,filecount);
  153.  
  154.       for j := 1 to filecount do
  155.       begin
  156.          writeln;
  157.          writeln('Archive: ',filetable[j]);
  158.          linenum := 1;
  159.          view_archive_text(filetable[j]);
  160.          flush(output);
  161.       end;
  162.    end;
  163. end.
  164.  
  165.